const BUS_URL = 'https://api.it120.cc/dha/'

export function request ({ url, method, data }) {
	return new Promise((resolve, reject) => {
		wx.request({
			url: BUS_URL + url,
			method: method || 'GET',
			data,
			header: {
				"content-type": "application/x-www-form-urlencoded"
			},
			timeout: 60000,
			success (res) {
				resolve(res.data)
			},
			fail (err) {
				reject(err)
			}
		});
	})
}
